﻿namespace BlamanticUI.Components;

/// <summary>qwdqwd
/// Render 'i' HTML tag to display icon.
/// </summary>
[HtmlTag("i")]
public class Icon : BlazorComponentBase, IHasColor, IHasInverted, IHasSize, IHasCircular, IHasLinked, IHasFitted, IHasBorder, IHasCornered, IHasVerticalAlignment
{
    /// <summary>
    /// Gets or sets the icon class, please refer https://fomantic-ui.com/elements/icon.html .
    /// </summary>
    [Parameter] public string IconClass { get; set; }
    /// <summary>
    /// Gets or sets the corner position. Only support in <see cref="IconGroup"/> component.
    /// </summary>
    [Parameter] public CornerPosition? Cornered { get; set; }
    /// <summary>
    /// Gets or sets the size.
    /// </summary>
    [Parameter] public Size? Size { get; set; }
    /// <summary>
    /// Gets or sets the color.
    /// </summary>
    [Parameter] public Color? Color { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether adapted inverted background by parent component.
    /// </summary>
    /// <value>
    ///   <c>true</c> if adapted; otherwise, <c>false</c>.
    /// </value>
    [Parameter] public bool Inverted { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether this is circular.
    /// </summary>
    /// <value>
    ///   <c>true</c> if circular; otherwise, <c>false</c>.
    /// </value>
    [Parameter] public bool Circular { get; set; }
    /// <summary>
    /// Gets or sets icon can be spined.
    /// </summary>
    [Parameter] [CssClass("loading")] public bool Spined { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether this is linked style.
    /// </summary>
    /// <value>
    ///   <c>true</c> if linked; otherwise, <c>false</c>.
    /// </value>
    [Parameter] [CssClass("link")] public bool Linked { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether this <see cref="Icon"/> is flipped.
    /// </summary>
    /// <value>
    ///   <c>true</c> if flipped; otherwise, <c>false</c>.
    /// </value>
    [Parameter] [CssClass("flipped")] public bool Flipped { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether this <see cref="Icon"/> is rotated.
    /// </summary>
    /// <value>
    ///   <c>true</c> if rotated; otherwise, <c>false</c>.
    /// </value>
    [Parameter] [CssClass("rotated")] public bool Rotated { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether the text remove paddings.
    /// </summary>
    /// <value>
    ///   <c>true</c> if fitted; otherwise, <c>false</c>.
    /// </value>
    [Parameter] public bool Fitted { get; set; }
    /// <summary>
    /// Gets or sets a value indicating whether to display borders.
    /// </summary>
    /// <value>
    ///   <c>true</c> if bordered; otherwise, <c>false</c>.
    /// </value>
    [Parameter] public bool Bordered { get; set; }
    /// <summary>
    /// Gets or sets the vertical alignment of icon in flex box.
    /// </summary>
    [Parameter] public VerticalAlignment? VerticalAlignment { get; set; }

    protected override void BuildCssClass(ICssClassBuilder builder)
    {
        builder.Append(IconClass).Append("icon");
    }
}
